gsktexture: Allow attaching render data to textures
authorBenjamin Otte <otte@redhat.com>
Wed, 16 Nov 2016 04:37:20 +0000 (05:37 +0100)
committerBenjamin Otte <otte@redhat.com>
Wed, 16 Nov 2016 16:36:33 +0000 (17:36 +0100)
commit48e7f4191fae6fdaf048e858694aa1d8e0b08673
treea46b0e3a35560707190f49f9babaf931ffda0603
parent40565fb0308ba2e8a91a853af024bff49bd84a38
gsktexture: Allow attaching render data to textures

This allows renderers (or anyone really) to attach "render data" to
textures. Only the first render data sticks.

You can gsk_texture_set_render_data() with the key you will use to
look the data up again, and if no data has been set yet, yours will be
set.

You can retrieve this data via gsk_texture_get_render_data() later on.
If your data has been cleared, NULL will be returned.

When gsk_texture_clear_render_data() is called (which the texture will
call when it is finalized), your destory notify will be called and you
have to release your render data.

The GL driver uses this to attach texture ids to GskTextures.
gsk/gskgldriver.c
gsk/gskgldriverprivate.h
gsk/gskglrenderer.c
gsk/gsktexture.c
gsk/gsktextureprivate.h